import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../../../../helper/utils/util.dart';
import 'index.dart';

class ValidateInputPage extends GetView<ValidateInputController> {
  const ValidateInputPage({super.key});

  // 主视图
  Widget _buildView() {
    var state = controller.state;
    return ListView(
      shrinkWrap: true,
      padding: EdgeInsets.zero,
      children: [
        SizedBox(height: 10.r),
        UITextField(
          margin: EdgeInsets.symmetric(horizontal: 30.r),
          title: '密码',
          hintText: '请输入密码',
          data: state.pwd,
          autoFocus: true,

          titleStyle: TextStyle(
            color: const Color(0xff333333),
            fontSize: 20.sp,
            fontWeight: FontWeight.bold,
          ),
          onChanged: (p0) {
            state.pwd = p0;
          },
          style: TextFieldStyle.underLine,
          padding: EdgeInsets.zero,
          height: 50.r,
          // backgroundColor: Colors.amber,
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ValidateInputController>(
      builder: (_) {
        return Scaffold(
          appBar: detailAppBar(context, title: '注销账号'),
          backgroundColor: Colors.white,
          body: Column(
            children: [
              Expanded(child: _buildView()),
              BottomBar(children: [
                Expanded(
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 16.r),
                    child: TextBtn(
                      onTap: controller.actionValidate,
                      bgColor: Colors.redAccent,
                      title: '注销',
                    ),
                  ),
                )
              ])
            ],
          ),
        );
      },
    );
  }
}
